2025-09-23 Assembly Lab

x86 Calling Conventions https://github.com/cs-uob/COMSM0049/blob/master/docs/labs/1.md

Q5

1

64 bytes

2

rbp points to the old value of the stack pointer rsp points to the current value of the stack pointer rbp is 64 bigger than rsp

3

DPNTN115 and :JTGVO

4

-56

5

-42

6

-5

7

rsi, adds 8 instead of 1 because in a 64-bit system each allocation has to be at least 8 bytes (64 bits), so need to skip all 64 bits.

8

COMS0049ISFUN

Q6

  • Zeroes eax
  • Loads effective address of 0 into rbx (0)
  • Decrements RCX to 0
  • Sets rdx to 0
  • Sets esi to 0
  • Sets edi to 0
  • Pushes 0 to the stack
  • Pops 0 from the stack to rbp